﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TpBaseObjects.Base {
    public class TpMenuGroup {

        #region Members

        private List<TpMenuGroupItem> myItems;
        private string groupName;
        private int index;

        #endregion

        #region Constructor

        

        public TpMenuGroup(string groupName, int index) {
            myItems = new List<TpMenuGroupItem>();
            this.groupName = groupName;
            this.index = index;
        }

        #endregion

        #region Properties

        public string GroupName {
            get { return this.groupName; }
        }

        public int ItemsCount {
            get { return myItems.Count; }
        }

        public int MyIndex {
            get { return this.index; }
        }

        public List<TpMenuGroupItem> MyItems {
            get { return myItems; }
        }

        #endregion

        #region Function

        public int GetMyMenuItemIndex(string menuName) {
            foreach (TpMenuGroupItem item in myItems) {
                if (item.MenuName == menuName) {
                    return item.MyIndex;
                }
            }
            return 0;
        }

        #endregion

        #region Methods

        public void AddItems(TpMenuGroupItem item) {
            myItems.Add(item);
        }

        #endregion

    }
}
